package com.navi.loaddata.loadService.impl.Dcdata.array;

import com.navi.loaddata.core.mesEntity.SpcDcResultData;
import com.navi.loaddata.core.mesEntity.SpcDcdata;
import com.navi.loaddata.core.mesEntity.SpcDcmeasuredataresult;
import com.navi.loaddata.core.mesEntity.SpcDcprocessdataresult;
import com.navi.loaddata.core.mysqlEntity.EtlConfD;
import com.navi.loaddata.core.mysqlEntity.EtlConfDModel;
import com.navi.loaddata.core.repository.impl.MesRepositoryImpl;
import com.navi.loaddata.core.util.ProcessUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;

@Service
@Transactional(transactionManager = "mesPlatformTransactionManager")
public class LoadDcInfoServiceARRAY2 {

    @Autowired
    private MesRepositoryImpl mesdao;

    public List<SpcDcdata> loadDcDataList(EtlConfDModel etlConfD, String dctype) {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
        StringBuffer hql = new StringBuffer();
        hql.append("FROM SpcDcdata WHERE 1=1")
                .append(" and TIMEKEY >='").append(sdf.format(etlConfD.getRunStartTimestamp()))
                .append("' and TIMEKEY < '").append(sdf.format(etlConfD.getRunEndTimestamp()))
                .append("' and subfactoryname = '").append(etlConfD.getShop()).append("' ")
//                .append(" AND RECIPENAME IS NOT NULL")
                .append(" and processoperationname not like 'DUM%' AND nvl(SUBSTR(PROCESSOPERATIONNAME, 6,7),'X') <> 'D'");
        if (!StringUtils.isEmpty(etlConfD.getOpe())) {
            hql.append(" and processoperationname = '").append(etlConfD.getOpe()).append("' ");
        }
        hql.append(" and dctype IN(").append(dctype).append(")");
        String hql1=hql.toString()+" and materialname in('A184V012BP','A184L01FCC','A184V029CB','A185Q00MAT','A185S010BT','A185R01BBC','A185U00YAW','A185T02FBW','A184V02ECE','A185400WAA','A185K00BAM','A185S01AAR','A185T02FBT','A185G003AA','A185M005AA','A1852025AD','A185R019BS','A185S00VBH','A185W00MBV','A185S01BCK','A185T024BD','A185T02FAA','A185T024BL','A185S012AG','A1857019CK','A185S015BA','A184T02CBY','A185W00LBG','A185701CCD','A184C017AD','A185T00ABN','A1853001BQ','A185400PCA','A185200DAM','A185200GAX','A185V018BA','A184V013CD','A1852023CH','A185R018AD','A184C017AL','A185K00XBE','A185K004AE','A184T02EAT','A185T009AL','A185R00YCC','A185S019AV','A185V031AL','A1851013AD','A185R017AL','A184T01LBP','A184V015AG','A185402TCK','A185601XAN','A1857019AD','A1853026BK','A185W004AA','A1854029CJ','A185400UAK','A185701FAH','A185202HAW','A185T023AL','A1854038AR','A1854029BP','A185400VAW','A185Q00FBY','A185403EBA','A185900TBP','A185500SBG','A185700GAX','A185701EAB','A185800XAD','A185700GCC','A185700LAB','A185502NBD','A185201TAS','A185900JAY','A185700YAT','A185500WAK','A185601CCG','A185800WAU','A185N00LBP','A185M007AM','A185Q00NBR','A185W005CB','A185W00GAL','A185601HBK','A185W012AB','A185W00HAS','A185700HAU','A185601JAR','A185501EAL','A1857018AJ','A185L00EAB','A185W00JAX','A185H027AD','A1853024AT','A185502FBT','A185601XBB','A185W013BS','A185402BCK','A185502AAL','A185800HAN','A185601XCJ','A185500SAN','A1855021AT','A185500SBY','A185501EAB','A185800PAG','A185701CAX','A185800NAH','A1857012AA','A185B00GAV','A185C013CD','A185M009BU','A185800PCK','A1857012AJ','A185900WAU','A185601HAB','A185800SAG','A185800NBG','A1853024BT','A185F006AM','A185U015AY','A185N006AP','A185M006AM','A185T02BCJ','A185W017CJ','A185M00BBR','A185H00NBG','A185U013AW','A185H00NAW','A185K002AW','A185H02BBD','A185H00PBQ','A185L00KAG','A184M01PBW','A184N01BBA','A184N01EAV','A184T02BAV','A185R01BAV','A185K00VBS','A185S01AAQ','A185N00JCK','A185M00DCJ','A185S010AU','A185P00QBK','A185Q00WAC','A185T029CH','A1856010BE','A185T024AH','A185F00KBB','A185S017CF','A185W00MCC','A185T024AX','A185C00QAL','A185M00ABY','A185C00QAE','A185P01DBR','A185R00XAT','A185P019BM','A185K00RBV','A185K00XBG','A1852027AD','A185R012CA','A185501CCF','A1853001CG','A185M005CA','A185S01CAU','A185J00QAN','A185P01EBA','A185G010CK','A185400NBS','A185600SBR','A1853001BA','A185200FBP','A184T01QBN','A185200FCE','A184500VAL','A185V02CAY','A185N00AAA','A1853014AD','A185700LAU','A1853003BA','A1853002AP','A185V031CA','A185N00GAP','A1853001BE','A185700XAA','A185403JBK','A1853015CA','A185R016AY','A185402TCJ','A185R010BG','A185U016AG','A184T02GCF','A1854010BJ','A185402TAM','A1854010BP','A185S00XAB','A185400QAR','A185402UAJ','A185403CAK','A185403CAM','A185V031BW','A185403EBU','A185900NAW','A1854014BH','A185502AAC','A185500UCK','A185800FCD','A185500UCH','A185502LAS','A185601YCE','A185402TBX','A185601XAB','A185502FCK','A185701FCH','A185S015BT','A185G004CB','A185V00MBM','A1856003CC','A185201WBD','A185502LAW','A185W00FBE','A185601GAH','A185701CAB','A185W005CG','A1856029BE','A1856010AH','A185700HCF','A185502NAF','A185502JAC','A185701AAX','A185W00KBM','A185500WCG','A185M00KAE','A185W00HAH','A185M005AX','A185700LBG','A185700YAD','A185501EAF','A1857019BE','A185900JBF','A185800KBB','A185L00AAQ','A185701EAM','A185502KBV','A185900LBJ','A185800KBS','A185W014AJ','A185701BAY','A185800HCG','A185C01QBW','A185800SBD','A1857019AT','A185701EBM','A185900NCD','A185P00LBD','A185M007AW','A185L00EBD','A185N00MBD','A185N005AR','A185Q00FAK','A185T022BQ','A185W00FCG','A185P017AD','A185K00DAV','A185L00DCJ','A185K00PAM','A185N00GAF','A185M00KAA','A185G01GCE','A185K001BL','A185K00UAQ','A185L00EAU','A185K00VAY','A185L00DBF','A185M00BAA','A185M009CG','A185U016BC','A185X007BE','A184M01PCH','A184T01PAR','A184W00JAT','A185S010BW','A185J00NAY','A185M00BCD','A185L00ABD','A185P01DBW','A185V018BK','A185L007AU','A185L00FCA','A185L00DBB','A185S00XCG','A185S01CAK','A185W00QCE','A184T01LBQ','A185L00PAA','A1852008AA','A185V015AB','A185U00MAT','A185601GAR','A185P00LBK','A185R019AH','A185T024BU','A185P01EAS','A184U00YBA','A185D00LAU','A185V017CH','A185H00LCE','A185502BBT','A185502ABA','A185400PAY','A1855010BF','A185J00TBG','A185E00QBJ','A185R00QBL','A185W00PCH','A185T021AT','A185T021AN','A185L00ABT','A185601RBD','A185W017BA','A185800HBQ','A185400SBT','A1852027AR','A185200FAW','A185S010CH','A185K00HCF','A1852023CB','A185200FCD','A185L00KAK','A185K00JCE','A185M00KAR','A185R00VBX','A185M00KAN','A184T01QCJ','A185R015CA','A1853002AY','A185402TCH','A185300AAN','A1853003BC','A1853008AA','A185300AAY','A1853003AQ','A1853003CJ','A185T026CE','A1852027AS','A185T02CAU','A185400NAN','A185700GBM','A185502JCG','A1851013AP','A185403CAX','A185601GAC','A185502MAW','A1854033AL','A185502FBS','A185S01ABB','A185S019BQ','A1854039BU','A1854039AB','A185U014BJ','A1854039AP','A185400PBA','A185502BAR','A1857010BJ','A185600SAA','A185700BAS','A1856011BV','A1855010CJ','A185800LCG','A185502JAF','A185800HCA','A185501EBD','A1853015AU','A185800WBB','A185500UBQ','A185Q00PAA','A185U022AT','A185P00TBK','A1857010BP','A185W00GAJ','A185800FBW','A185M00ECA','A1856020AC','A185501CBR','A185502JAT','A185502LAN','A185W00GBE','A1854011BW','A185W013BD','A185W00GAW','A185R016AE','A185W00KCK','A185W013AD','A185W012AC','A185501CBH','A185W00FCK','A185500XBC','A185701ABJ','A1856028AA','A185C013CG','A185G01GAD','A185501EBP','A185800SBB','A1857019AV','A185C013BR','A185K00UBN','A185502MBG','A185M00MAQ','A185800MAD','A185K00ABY','A185W004BD','A185L00CAU','A185W00FCE','A185W014AC','A185G003BP','A185T02DBG','A185G00UBS','A185U00MBD','A185X00BBS','A185M00DAE','A185H00LCK','A185H00SBY','A185J00NCE','A185K003AD','A185K00XAB','A185L00FAK','A185L00FBF','A185L00KBR','A1853017AG','A185T023AK','A185X00XCH','A184L01FCA','A184N01BBH','A185P01GAP','A185S017BV','A185P01BAP','A185T009BG','A184T01LAM','A185N00MBT','A185S017AK','A185M00ABE','A185L00BBG','A185H025BT','A1853015BE','A185V016CE','A185S01CAD','A185S012BP','A1852007AA','A185T02EAK','A185V018BQ','A185900VBN','A185800SBF','A185V01BCD','A185M00ACC','A185K00SCJ','A185R00XCC','A185T024AJ','A185V02AAF','A1853009BT','A185T021BU','A185T026CA','A185S015BE','A185V01BBD','A185V02CBB','A1852023BY','A1852023CC','A185L00BAT','A185K00VAT','A185N00GCG','A185401WBS','A185600SBS','A185601RCG','A1854010AX','A185200FBX','A185200FBQ','A185202JAH','A185V02CAS','A185M00KAP','A185M004AT','A185P01BCD','A185N004AQ','A1853003CG','A185M009BR','A185U00WCC','A185N008AN','A185N00CCJ','A185E00VAE','A185R010BA','A185402TCE','A1853025AE','A1852005AU','A185400NCF','A185400NCJ','A185D00CBV','A185700HCH','A1854033BJ','A185400VBG','A185402UBD','A185403EAP','A1854039AF','A185403EAG','A1854033AQ','A185502ACA','A185601CCB','A185800SBR','A185900WAT','A1856005BF','A185600SAC','A1856010AM','A1856004AV','A185800XAM','A185502ABS','A185500UBV','A185800LCJ','A185K00PAL','A185701EAY','A185502KAF','A185V014AJ','A185W00GBT','A185T009CD','A185W00HCC','A185500SBX','A185W015BT','A185800UBH','A185T026BB','A185W004BA','A185601NAU','A185T02CCB','A185701BAS','A185Q00PAU','A185700EBU','A185502AAP','A185G004AG','A185C013BY','A1857018CH','A185501CCB','A185800KBE','A185C00RCH','A185601BAX','A185800MAN','A185C00RCG','A1855022CD','A1857011BK','A1857018BX','A185H00MCH','A185L00NBU','A185M00MAR','A185M00HAA','A185M00EAF','A185F00BBV','A184V02FBE','A185T02CBC','A185M006AN','A185W012AS','A185K00SBA','A185H00LBF','A185N009AQ','A185F00GBF','A185T026BJ','A185L00LBV','A185J00QAQ','A185M008AT','A185D00CAB','A185U015AX','A185W00FCD','A185K002BV','A185L00FAQ','A185H01RBU','A185T02GBR','A184M01PBL','A184M01SBB','A185Q00MBG','A185U014BD','A1857016AV','A185H00UAF','A185A00LBK','A185V02BAN','A184W026AP','A185P00TAG','A185L00MAB','A185Q00QAV','A185T02BBJ','A185L00BCH','A185U00MAF','A185P00TBR','A185T029CK','A184H01GAH','A185P01BCF','A185N00GAY','A184V019CB','A185L00MBF','A185T027BQ','A185800MAF','A185T024BN','A185900WCD','A185T024AV','A185V016AL','A185700NAT','A185K00SBR','A185L00JBV','A185T024BA','A184V01ACG','A185700NAM','A185V02BAB','A185S01CAC','A185403JAN','A185701BCK','A185500QBG','A185400NBX','A185V02ABR','A185V02CBL','A1853003BB','A185800FAA','A185D00CCA','A185L00PCK','A185M00JCE','A185Q00LAR','A184T01NAV','A1853003CB','A185300AAX','A184V02FAS','A184T01YBM','A185V033CE','A185Q00PCB','A185400NCD','A185700VAG','A185700AAJ','A185V032AF','A185400MBC','A1853024BK','A184J00QBG','A1853027CK','A185U025CA','A185700EBL','A183M00RBE','A185400LAM','A185401WAR','A185402TCC','A185500SBP','A185402UAX','A185200BAE','A185800NAK','A1854034BJ','A185403CAP','A185403EAC','A1854039AC','A1854033AS','A185502NCE','A185401WAW','A1856010AA','A1853026BT','A1855024BU','A185500WAD','A184V02FAR','A185900TAL')";
        String hql2=hql.toString()+" and materialname in('A185900TAN','A185900NAE','A185500SAQ','A185500SAT','A185502JBF','A185800XAQ','A185700LAS','A185W005BU','A1856005AR','A185601GAN','A185K00CCF','A1855022AP','A185B00EBD','A1854039CK','A185500UBK','A185V018AR','A185601XAH','A185502LAR','A185W00KBF','A185500WBE','A185U022AJ','A185502ABT','A185W00KBW','A185T029AT','A185W013BL','A185501ECJ','A185500SCF','A185402TBA','A1857018CG','A185C013CH','A185L00MAV','A185C013AV','A185400PAG','A185W005CK','A185C00RCB','A185G00QAB','A185D008BX','A185900UBC','A185K00PBV','A185C013BS','A1857019AS','A184T01LBB','A1857018CA','A185701EBW','A185R00WCC','A185W00KAM','A185W00FBL','A185R016BE','A185W016CA','A185G00SAQ','A185K002AX','A185J00TBU','A185U015BS','A185W014AA','A185K00TAL','A185K00XAK','A185L00FAL','A185J00SCA','A185M00EAT','A185T02CCC','A185T023AW','A184M01PBT','A184M01PCC','A184T020AC','A184M01PAF','A184M01PAN','A184U00UBJ','A185P01HAQ','A185U011BT','A185T027AR','A185T02ACE','A185T021AL','A185V015BV','A185N00MBP','A185N00MBN','A185M00GBX','A184W022AU','A185P018CH','A185L00PAD','A185701BAB','A185U023BJ','A185S017AW','A185S01BAD','A185W004CG','A185T02FCA','A185V00LBA','A185N00JAQ','A185V019AW','A185800HBG','A185S016AV','A185T021AP','A1854039BY','A1853003CH','A185K00SAA','A185F00FCB','A185S012BS','A185S01CBK','A185L009BF','A185L00ACE','A185G00PAE','A185J00QCK','A1854029AA','A185402BBG','A185V02BAX','A185200FBS','A185U00MAU','A1852023CE','A185V017CD','A184T02FCD','A185T009AD','A1853005AF','A185U00XAH','A1853005CK','A185400SAY','A184W027BN','A185S00VAV','A185400MCB','A184G00XBM','A185700LAF','A185400SAK','A185N006CC','A185P01GAV','A185500WAQ','A185400WBS','A185701CAW','A185403CBU','A185U014AT','A185M00EAA','A185U00LAT','A185700HAA','A185500UCD','A185700WAK','A185G004CA','A185P01CAK','A185402TBN','A185L00KBB','A185V017AY','A1856003BU','A185601HBB','A185W00NAD','A185502BCK','A1857018AT','A185U022AF','A185500YAK','A185W004AW','A185700NBE','A185U00YBY','A185701EBQ','A185C013BU','A185900XAX','A185900JBH','A185L00AAL','A185K00PAY','A185C00QAH','A185700YAS','A185B00GBH','A185K00ABX','A185K00GBH','A185M00HAB','A185J00HCE','A185M004AB','A185U015AV','A185S016AY','A185W00LBJ','A185M00CCA','A185K004AP','A1853017BT','A185H00MBC','A185U013BA','A185K00XAF','A184M01PBS','A184V02VBX','A184V018AK','A184V00XBP','A185L00FBM','A185L00NBG','A185N00JBP','A185U011AS','A185S014CC','A185S01CBJ','A185T029CE','A185V026CB','A185Q00QAU','A185M00CBM','A185M007AV','A185L00BBF','A185200HBX','A185V00MAN','A185V015BH','A185Q00WBD','A185400WAN','A1853002AB','A185D00ECD','A185T024AT','A185T02BAT','A185N00KBG','A185H003AK','A185L00HBG','A185K00SAS','A185T021BB','A185202VCJ','A185501CCH','A1853009CF','A185T021AU','A185W00MAB','A185L00RAB','A185L00ACG','A185L00RAA','A185L00ABK','A185L00ACH','A185J00KAR','A185H00NBF','A185601RBN','A185H00MBP','A185A00RBY','A184H01GAD','A185200FBD','A184G00XCD','A185V02CBK','A184V00DBC','A185M00KBD','A184T01QBL','A185V02CBU','A185K004AJ','A185S00YBU','A1853003BU','A185Q00PBY','A184W00JAS','A1851026AM','A185400NAT','A185400NBR','A185401WBQ','A1854038BT','A185T009AQ','A1855022BV','A185400YBR','A185800FCC','A185800SAX','A1857011AW','A185403CBM','A185402UAG','A185403CAC','A1854039BS','A1854039CA','A185A00RBL','A185500UCJ','A1857010BD','A185502JAL','A185900JBN','A185800UBK','A185800UAV','A185501EAM','A185800WAX','A185601HAD','A185700YBA','A185502NAH','A185601XCD','A185U015AU','A1856005BC','A1856003AF','A185800HBM','A185700VBC','A185700YAV','A185C01QCD','A1857013CK','A185900WBU','A185S019CG','A185800WAN','A185L00JAK','A185800FBL','A1857019AX','A185501DBS','A185800SBQ','A185G003AC','A185C013AX','A185M00EAM','A185K00GAR','A185G00KAY','A185W00QAD','A185W00LBT','A185W00HAP','A185W00PCA','A185U012BM','A185R016BQ','A185T023BH','A185N005AL','A185K003BH','A185W013BX','A185M008AH','A185U015BU','A185K003AL','A185K00TAG','A185K00PBA','A185L00ABM','A185M005BF','A185W016BL','A185X008AE','A184V02WAG','A184V018AR','A184U00UAQ','A184T01PAA','A184T01TCD','A185P01HAT','A185K00HBN','A184T01VBK','A185H00LBR','A185T029CD','A185V02AAH','A185S014CB','A185S01AAV','A1857015BY','A184V02FCK','A185U011AU','A185N00LBS','A185P01HBT','A185T02EAJ','A1855022AY','A185U015BM','A185V00MCC','A185V01AAX','A185900WBJ','A185N00JAM','A185P019CH','A185S012AA','A185Q00LBQ','A185F006AR','A185S018CF','A185601AAT','A185700GCA','A185V02ACJ','A1852023CK','A1852038BE','A185L009BC','A185J00MBB','A185W00MAG','A185800HBT','A185300ABB','A185H00MBL','A185200FCJ','A185200FBW','A185V018BB','A185200FAU','A1852023CA','A185V02BCF','A1853005AK','A1856019CD','A185M004AR','A185200KBL','A185U00YBS','A185R010BD','A1853002AX','A185V032BS','A185300BAC','A185V032BT','A1853015BG','A1851014BK','A1854033CE','A1851026AF','A1854033BL','A185402UBR','A185N007AU','A185401WBE','A185402TAB','A185403CCE','A185U024AD','A1854039AY','A1854039AJ','A185800FCH','A185A00RBB','A185601NCD','A185502MBU','A1856004AN','A1856019CB','A185502KBM','A1855022BH','A185501EAQ','A1856003BT','A185502LAU','A185L00BBS','A185W00GAH','A185W013BR','A185W00NAK','A1857018CJ','A185700WAE','A185T02CAR','A185U022AV','A185T02BCG','A1856010AL','A185Q00SBB','A185701EBP','A185500SCK','A185502JBH','A185501CBK','A185C013CA','A185701AAV','A185C01KBQ','A185800PBK','A185800PBC','A185800PBA','A185L00AAW','A185800NCD','A185Q00DBC','A185701ABQ','A1851013BB','A185S012BJ','A185A00SAR','A1853002AF','A185P00LBE','A185M00MAS','A185K00GBC','A185C01KBV','A185L00ABA','A185V017BY','A185N00DBY','A185G00NBA','A185P00TBH','A185N00MAW','A185W00GBD','A185W00KAR','A185N00MBL','A185T025BW','A185J00QAU','A185H00SBU','A185K00UAJ','A185L00EAW','A184T02JBP','A185K00DCC','A185K00CCG','A185K00CBT','A185K00XAL','A185T026CD','A185U016BE','A185X007BR')";
        List<SpcDcdata> list1=mesdao.list(SpcDcdata.class, hql1);
        List<SpcDcdata> list2=mesdao.list(SpcDcdata.class, hql2);
        if(!list2.isEmpty()) list2.forEach(e -> list1.add(e));

        return list1;
    }

    public List<SpcDcResultData> loadMDataList(EtlConfDModel etlConfD, long dcdataid) {
        List<SpcDcmeasuredataresult> spcDcmeasuredataresultList =new ArrayList<>();
        List<SpcDcResultData> spcDcResultDataList=new ArrayList<>();
        StringBuffer hql = new StringBuffer();
        hql.append("FROM SpcDcmeasuredataresult WHERE dcdataid =").append(dcdataid)
        .append(" order by itemname, sitename");
        spcDcmeasuredataresultList =mesdao.list(SpcDcmeasuredataresult.class, hql.toString());
        spcDcmeasuredataresultList.forEach(e->{
            SpcDcResultData spcDcResultData=new SpcDcResultData();
            spcDcResultData.setDcdataid(e.getDcdataid());
            spcDcResultData.setSeq(e.getSeq());
            spcDcResultData.setSamplematerialname(ProcessUtil.processString(e.getSamplematerialname()));
            spcDcResultData.setItemname(ProcessUtil.processString(e.getItemname()));
            spcDcResultData.setSitename(ProcessUtil.processString(e.getSitename()));
            spcDcResultData.setSitetype(ProcessUtil.processString(e.getSitetype()));
            spcDcResultData.setAliasitemname(ProcessUtil.processString(e.getAliasitemname()));
            spcDcResultData.setDatatype(ProcessUtil.processString(e.getDatatype()));
            spcDcResultData.setResult(ProcessUtil.processString(e.getResult()));
            spcDcResultData.setEventname(ProcessUtil.processString(e.getEventname()));
            spcDcResultData.setTimekey(ProcessUtil.processString(e.getTimekey()));
            spcDcResultData.setEventtime(e.getEventtime());
            spcDcResultData.setEventuser(ProcessUtil.processString(e.getEventuser()));
            spcDcResultData.setEventcomment(ProcessUtil.processString(e.getEventcomment()));
            spcDcResultData.setUpdatetime(e.getUpdatetime());
            spcDcResultDataList.add(spcDcResultData);
        });
        return spcDcResultDataList;
    }

    public List<SpcDcResultData> loadPDataList(EtlConfDModel etlConfD, long dcdataid) {
        List<SpcDcprocessdataresult> spcDcprocessdataresult =new ArrayList<>();
        List<SpcDcResultData> spcDcResultDataList=new ArrayList<>();
        StringBuffer hql = new StringBuffer();
        hql.append("FROM SpcDcprocessdataresult WHERE dcdataid =").append(dcdataid)
                .append(" order by itemname, sitename");
        spcDcprocessdataresult =mesdao.list(SpcDcprocessdataresult.class, hql.toString());
        spcDcprocessdataresult.forEach(e->{
            SpcDcResultData spcDcResultData=new SpcDcResultData();
            spcDcResultData.setDcdataid(e.getDcdataid());
            spcDcResultData.setSeq(e.getSeq());
            spcDcResultData.setSamplematerialname(ProcessUtil.processString(e.getSamplematerialname()));
            spcDcResultData.setItemname(ProcessUtil.processString(e.getItemname()));
            spcDcResultData.setSitename(ProcessUtil.processString(e.getSitename()));
            spcDcResultData.setSitetype(ProcessUtil.processString(e.getSitetype()));
            spcDcResultData.setAliasitemname(ProcessUtil.processString(e.getAliasitemname()));
            spcDcResultData.setDatatype(ProcessUtil.processString(e.getDatatype()));
            spcDcResultData.setResult(ProcessUtil.processString(e.getResult()));
            spcDcResultData.setEventname(ProcessUtil.processString(e.getEventname()));
            spcDcResultData.setTimekey(ProcessUtil.processString(e.getTimekey()));
            spcDcResultData.setEventtime(e.getEventtime());
            spcDcResultData.setEventuser(ProcessUtil.processString(e.getEventuser()));
            spcDcResultData.setEventcomment(ProcessUtil.processString(e.getEventcomment()));
            spcDcResultData.setUpdatetime(e.getUpdatetime());
            spcDcResultDataList.add(spcDcResultData);
        });
        return spcDcResultDataList;
    }


    private String getOpeHql(String confOpe) {
        if (StringUtils.isEmpty(confOpe)) {
            return "";
        }

        StringBuffer hql = new StringBuffer();
        if ("*".contains(confOpe)) {
            //todo 允许模糊匹配
        } else {
            hql.append(" and opeId='").append(confOpe).append("' ");
        }

        return hql.toString();
    }


}
